﻿





$(document).ready(function () {



    $(".joinBTN").click(function () {

        var bname = $(this).attr('id');

           var request = $.ajax({
                    type: 'POST',
                    url: "/joinBoard",
                    dataType: "json",
                    data: { boardName: bname}


                });
                request.done(function (data) {

                    if (data.redirect) {
                        // data.redirect contains the string URL to redirect to
                        window.location.replace(data.redirect);
                    }
                    else {

                    }
                });
    });

    $("#logOutBtn").click(function () {


        window.location.replace("/logout");


    });

    var title = $("#title"),

			allFields = $([]).add(title),
			tips = $(".validateTips");


   


    $('ol.dribbbles li div.dribbble-img').fadeable({ target: 'a.dribbble-over' });










});


      
    $.fn.fadeable = function (options) {

        var settings = {
            target: this,
            duration: 'fast'
        };
        $.extend(settings, options)

        $(this).live('hover', function (event) {
            switch (event.type) {
                case 'mouseenter':
                    $(this).find(settings.target).stop().fadeTo(settings.duration, 1);
                    break;
                case 'mouseleave':
                    $(this).find(settings.target).stop().fadeTo(settings.duration, 0);
                    break;
            }
        });
    }        